Optimal. Leaf size=133 \[ \frac {\left (2 a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2} d}-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {3 a b \tan (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3918, 4088, 12,
3916, 2738, 214} \begin {gather*} \frac {\left (2 a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{5/2} (a+b)^{5/2}}-\frac {3 a b \tan (c+d x)}{2 d \left (a^2-b^2\right )^2 (a+b \sec (c+d x))}-\frac {b \tan (c+d x)}{2 d \left (a^2-b^2\right ) (a+b \sec (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 3916
Rule 3918
Rule 4088
Rubi steps
\begin {align*} \int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^3} \, dx &=-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {\int \frac {\sec (c+d x) (-2 a+b \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx}{2 \left (a^2-b^2\right )}\\ &=-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {3 a b \tan (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}+\frac {\int \frac {\left (2 a^2+b^2\right ) \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{2 \left (a^2-b^2\right )^2}\\ &=-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {3 a b \tan (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}+\frac {\left (2 a^2+b^2\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{2 \left (a^2-b^2\right )^2}\\ &=-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {3 a b \tan (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}+\frac {\left (2 a^2+b^2\right ) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{2 b \left (a^2-b^2\right )^2}\\ &=-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {3 a b \tan (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}+\frac {\left (2 a^2+b^2\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right )^2 d}\\ &=\frac {\left (2 a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2} d}-\frac {b \tan (c+d x)}{2 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {3 a b \tan (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.49, size = 115, normalized size = 0.86 \begin {gather*} \frac {-\frac {2 \left (2 a^2+b^2\right ) \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+\frac {b \left (-3 a b+\left (-4 a^2+b^2\right ) \cos (c+d x)\right ) \sin (c+d x)}{(b+a \cos (c+d x))^2}}{2 (a-b)^2 (a+b)^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 186, normalized size = 1.40
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (-\frac {\left (4 a +b \right ) b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 b a +b^{2}\right )}+\frac {\left (4 a -b \right ) b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a +b \right ) \left (a^{2}-2 b a +b^{2}\right )}\right )}{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a -b \right )^{2}}+\frac {\left (2 a^{2}+b^{2}\right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a^{4}-2 b^{2} a^{2}+b^{4}\right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(186\) |
default | \(\frac {-\frac {2 \left (-\frac {\left (4 a +b \right ) b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 b a +b^{2}\right )}+\frac {\left (4 a -b \right ) b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a +b \right ) \left (a^{2}-2 b a +b^{2}\right )}\right )}{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a -b \right )^{2}}+\frac {\left (2 a^{2}+b^{2}\right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a^{4}-2 b^{2} a^{2}+b^{4}\right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(186\) |
risch | \(\frac {i b \left (-5 b \,a^{3} {\mathrm e}^{3 i \left (d x +c \right )}+2 a \,b^{3} {\mathrm e}^{3 i \left (d x +c \right )}-4 a^{4} {\mathrm e}^{2 i \left (d x +c \right )}-7 a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{4} {\mathrm e}^{2 i \left (d x +c \right )}-11 a^{3} b \,{\mathrm e}^{i \left (d x +c \right )}+2 b^{3} a \,{\mathrm e}^{i \left (d x +c \right )}-4 a^{4}+b^{2} a^{2}\right )}{a^{2} \left (-a^{2}+b^{2}\right )^{2} d \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )^{2}}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) b^{2}}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) a^{2}}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) b^{2}}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}\) | \(499\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 269 vs.
\(2 (120) = 240\).
time = 2.97, size = 595, normalized size = 4.47 \begin {gather*} \left [\frac {{\left (2 \, a^{2} b^{2} + b^{4} + {\left (2 \, a^{4} + a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - 2 \, {\left (3 \, a^{3} b^{2} - 3 \, a b^{4} + {\left (4 \, a^{4} b - 5 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{8} - 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} - a^{2} b^{6}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} d\right )}}, \frac {{\left (2 \, a^{2} b^{2} + b^{4} + {\left (2 \, a^{4} + a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (3 \, a^{3} b^{2} - 3 \, a b^{4} + {\left (4 \, a^{4} b - 5 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{8} - 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} - a^{2} b^{6}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 254 vs.
\(2 (120) = 240\).
time = 0.53, size = 254, normalized size = 1.91 \begin {gather*} -\frac {\frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} {\left (2 \, a^{2} + b^{2}\right )}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {4 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )}^{2}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.18, size = 204, normalized size = 1.53 \begin {gather*} \frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (b^2+4\,a\,b\right )}{{\left (a+b\right )}^2\,\left (a-b\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a\,b-b^2\right )}{\left (a+b\right )\,\left (a^2-2\,a\,b+b^2\right )}}{d\,\left (2\,a\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2-2\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^2-2\,a\,b+b^2\right )+a^2+b^2\right )}+\frac {\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a-2\,b\right )\,\left (a^2-2\,a\,b+b^2\right )}{2\,\sqrt {a+b}\,{\left (a-b\right )}^{5/2}}\right )\,\left (2\,a^2+b^2\right )}{d\,{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________